﻿
using System.ServiceModel.Channels;
using System.ServiceModel;
using NUnit.Framework;
using System.ServiceModel.Web;
using System.ServiceModel.Description;
namespace AdventureWorks.Services.Test.IntergrationTest
{
    [TestFixture, Category("Integration")]
    public class CustomServiceHost
    {
        private WebServiceHost host;

        [SetUp]
        public void Setup()
        {
            host = new WebServiceHost(typeof(IProductService));
            var binding = new WebHttpBinding();
            var endPoint = host.AddServiceEndpoint(typeof(IProductService), binding, "http://localhost/product");
            endPoint.Behaviors.Add(new WebHttpBehavior());
            host.Open();
        }

        [TearDown]
        public void Teardown()
        {
            host.Close();
        }


        [Test]
        public void CanTestMethod()
        {
            var binding = new WebHttpBinding();

            var proxy = new WebChannelFactory<IProductService>(binding);
            
        }

    }
}
